#ifndef CFRAMELESSWIDGET_H
#define CFRAMELESSWIDGET_H

#include <QObject>
#include <QWidget>

class CFramelessWidget : public QWidget
{
    Q_OBJECT
public:
    explicit CFramelessWidget(QWidget *parent = nullptr);
     ~CFramelessWidget();
protected:
    bool nativeEvent(const QByteArray& eventType, void* message, long*result) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
private:
   int m_nBorderWidth = 5;
   bool _isDragging;  // 是否正在拖拽
   QPoint _dragStartPos;  // 拖拽开始时的鼠标位置（相对于窗口）

};

#endif // CFRAMELESSWIDGET_H
